package com.gxgeek.javabasic.Thread;

import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @author gaoxing
 * @create 2018-07-12 上午11:19
 */
public class JoinThread extends Thread{

    private String name;

    public JoinThread(String name) {
        this.name = name;
    }

    @Override
    public void run() {
        System.out.println(String.format("%s 线程启动了",name));
    }

    public static void main(String[] args) throws InterruptedException {
        JoinThread joinThread = new JoinThread("1 ");
        JoinThread joinThread2 = new JoinThread("2 ");
        JoinThread joinThread3 = new JoinThread("3 ");
//        joinThread.start();
//        joinThread.join();
//        joinThread2.start();
//        joinThread2.join();
//        joinThread3.start();
//        joinThread3.join();
//        ExecutorService service = Executors.newSingleThreadExecutor();
//        service.submit(joinThread);
//        service.submit(joinThread2);
//        service.submit(joinThread3);
//        service.shutdown();

    }
}


